package com.glomozda.machinerepairdao.domain.order;

import java.sql.Date;

@SuppressWarnings({"PMD.CommentRequired", "PMD.LawOfDemeter"})
public class Order {
	private Integer orderID;
	private Integer clientID;
	private Integer repairTypeID;
	private Integer machineID;
	private Date start;
	private String status;
	
	public Order(){
	}

	public Order(final Integer clientID, final Integer repairTypeID,
			final Integer machineID, final Date start) {
		this.clientID = clientID;
		this.repairTypeID = repairTypeID;
		this.machineID = machineID;
		this.start = start;
		this.status = "started";
	}
	
	public Order(final Integer clientID, final Integer repairTypeID,
			final Integer machineID, final Date start, final String status) {
		this.clientID = clientID;
		this.repairTypeID = repairTypeID;
		this.machineID = machineID;
		this.start = start;
		this.status = status;
	}
	
	public Integer getOrderID() {
		return orderID;
	}

	public void setOrderID(final Integer orderID) {
		this.orderID = orderID;
	}

	public Integer getClientID() {
		return clientID;
	}

	public void setClientID(final Integer clientID) {
		this.clientID = clientID;
	}

	public Integer getRepairTypeID() {
		return repairTypeID;
	}

	public void setRepairTypeID(final Integer repairTypeID) {
		this.repairTypeID = repairTypeID;
	}

	public Integer getMachineID() {
		return machineID;
	}

	public void setMachineID(final Integer machineID) {
		this.machineID = machineID;
	}

	public Date getStart() {
		return start;
	}

	public void setStart(final Date start) {
		this.start = start;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(final String status) {
		this.status = status;
	}

	@Override
	public int hashCode() {
		int hash = 3;
		hash = 13 * hash + (this.clientID != null ? this.clientID.hashCode() : 0);
		hash = 13 * hash + (this.repairTypeID != null ? this.repairTypeID.hashCode() : 0);
		hash = 13 * hash + (this.machineID != null ? this.machineID.hashCode() : 0);
		hash = 13 * hash + (this.start != null ? this.start.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(final Object obj) {
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		final Order other = (Order) obj;
		if ((this.clientID == null) ? other.clientID != null : !this.clientID.equals(other.clientID)) {
			return false;
		}
		if ((this.repairTypeID == null) ? other.repairTypeID != null : !this.repairTypeID.equals(other.repairTypeID)) {
			return false;
		}
		if ((this.machineID == null) ? other.machineID != null : !this.machineID.equals(other.machineID)) {
			return false;
		}
		if ((this.start == null) ? other.start != null : !this.start.equals(other.start)) {
			return false;
		}
		return true;
	}    

	@Override
	public String toString() {
		return "order{" + "orderID=" + orderID + ", clientID=" + clientID + 
				", repairTypeID=" + repairTypeID + ", machineID=" + machineID + 
				", start=" + start + ", status=" + status + '}'+"\n";
	}
}
